home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / lst / lstSucc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-19  |  1.2 KB  |  48 lines

  1. /*-
  2.  * LstSucc.c --
  3.  *    return the successor to a given node
  4.  *
  5.  * Copyright (c) 1988 by University of California Regents
  6.  *
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appears in all copies.  Neither the University of California nor
  11.  * Adam de Boor makes any representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15. #ifndef lint
  16. static char *rcsid =
  17. "$Id: lstSucc.c,v 1.4 88/11/17 20:54:07 adam Exp $ SPRITE (Berkeley)";
  18. #endif lint
  19.  
  20. #include    "lstInt.h"
  21.  
  22. /*-
  23.  *-----------------------------------------------------------------------
  24.  * Lst_Succ --
  25.  *    Return the sucessor to the given node on its list.
  26.  *
  27.  * Results:
  28.  *    The successor of the node, if it exists (note that on a circular
  29.  *    list, if the node is the only one in the list, it is its own
  30.  *    successor).
  31.  *
  32.  * Side Effects:
  33.  *    None.
  34.  *
  35.  *-----------------------------------------------------------------------
  36.  */
  37. LstNode
  38. Lst_Succ (ln)
  39.     LstNode    ln;
  40. {
  41.     if (ln == NILLNODE) {
  42.     return (NILLNODE);
  43.     } else {
  44.     return ((LstNode) ((ListNode) ln)->nextPtr);
  45.     }
  46. }
  47.  
  48.